package com.atguigu.controller;

import com.atguigu.commonutils.R;
import com.atguigu.service.impl.CrmBannerService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.atguigu.educms.entity.CrmBanner;

import java.util.List;

/**
 * @author cyt
 * @create 2020-05-14 11:27
 */

@Api(description = "轮播图")
@RequestMapping("/educms/banner")
@RestController
public class EduFrontBannerController {
    @Autowired
    CrmBannerService service;

    /**
     * 查询首页轮播图
     * @return
     */
    @GetMapping("/getBanner")
    public R getBanner() {
        List<CrmBanner> list = service.getBanner();
        return R.ok().data("item", list);
    }


}
